<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="renderer" content="webkit">
	<title>添加专题</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<!--[if lt IE 9]>
	<meta http-equiv="refresh" content="0;ie.html" />
	<![endif]-->
	<link rel="shortcut icon" href="favicon.ico">
	<link href="__STATIC__/css/bootstrap.min.css" rel="stylesheet">
	<link href="__STATIC__/css/font-awesome.min.css" rel="stylesheet">
	<link href="__STATIC__/css/animate.css" rel="stylesheet">
	<link href="__STATIC__/css/style.css" rel="stylesheet">
	<!--表单元素css-->
	<link href="__STATIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
</head>
<body class="fixed-sidebar full-height-layout gray-bg">
<div id="wrapper">
	<!--左侧导航开始-->
	<include file="Public/left" title="left" />
	<!--左侧导航结束-->
	<!--右侧部分开始-->
	<div id="page-wrapper" class="gray-bg dashbard-1" style="height: auto;">
		<include file="Public/top" title="top" />
		<div class="row J_mainContent" id="content-main">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>应用管理</h5>
					</div>
					<div class="ibox-content">
						<form method="post" action="{:U('Articles/update')}" id="signupform"  enctype="multipart/form-data" class="form-horizontal">
							<div class="form-group">
							<label class="col-sm-2 control-label">ID</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" readonly="readonly"  name="arId"  value="{$post.arid}">
							</div>
						</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">图片</label>
								<div class="col-sm-10">
									<img src="__IMG__{$post.arimgs}"  height="100" width="100" alt="" />
									<div class="form-group">
										<div class="col-sm-10">
											<p ><a onclick="fileSelect();" style="cursor:default;background: #268df7;color: #fff;padding: 5px 10px;">更改图片</a></p>
											<p id="imgppp" style="display:none;text-align:center;"><input type="file" name="fileToUpload" id="fileToUpload" onchange="fileSelected();"></p>
										</div>
									</div>
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">名称</label>
								<div class="col-sm-10">
									<input type="text" class="form-control"  name="arName" value="{$post.arname}">
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">苹果地址</label>
								<div class="col-sm-10">
									<input type="text" class="form-control"  name="arIOS"  value="{$post.arios}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">安卓网址</label>
								<div class="col-sm-10">
									<input type="text" class="form-control"  name="arAndroid"  value="{$post.arandroid}">
								</div>
							</div>
							<div class="form-group">
									<label class="col-sm-2 control-label">展示开始时间</label>
									<div class="col-sm-10">
										<input placeholder="开始日期" class="form-control layer-date" id="startTime" name="startTime" value="{$post.starttime|substr=0,10}">
									</div>
						    </div>
							<div class="form-group">
								<label class="col-sm-2 control-label">展示结束时间</label>
								<div class="col-sm-10">
									<input placeholder="结束时间" class="form-control layer-date" id="endTime" name="endTime" value="{$post.endtime|substr=0,10}">
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<label class="col-sm-2 control-label">备注</label>
								<div class="col-sm-10">
									<input type="text" class="form-control"   name="remark" value="{$post.remark}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">下载次数</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" readonly="readonly"  name="upnum" value="{$post.upnum}">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">是否推荐</label>
								<div class="col-sm-10">
									<if condition="$post.ishot eq  1">
										<input type="checkbox" class="i-checks"  value="1"  checked="checked" name="ishot" value="{$post.ishot}">
										<else/>
										<input type="checkbox" class="i-checks"  value="1"   name="ishot" value="{$post.ishot}">
									</if>
								</div>
							</div>
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<div class="col-sm-4 col-sm-offset-2">
									<button type="submit" class="btn btn-info" id="submit">更新</button>
								</div>
							</div>

						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--右侧部分结束-->
</div>
</body>

</html>
<!-- 全局js -->
<script src="__STATIC__/js/jquery.min.js"></script>
<script src="__STATIC__/js/bootstrap.min.js"></script>
<script src="__STATIC__/js/laydate/laydate.js"></script>
<script src="__STATIC__/js/content.js"></script>
<script src="__STATIC__/js/plugins/iCheck/icheck.min.js"></script>
<script src="__STATIC__/js/plugins/validate/jquery.validate.js"></script>
<script src="__STATIC__/js/plugins/validate/messages_zh.js"></script>
<script>
    laydate.render({
        elem: '#startTime',
        max: '2099-06-16 23:59:59',
        type:"date"
    });
    laydate.render({
        elem: '#endTime',
        max: '2099-06-16 23:59:59',
        type:"date"
    });
</script>
<script>
    $(document).ready(function() {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    });
</script>
 <script type="text/javascript">
    function fileSelect() {
        document.getElementById("fileToUpload").click();
    }
    function fileSelected() {

        $('#imgppp').show();
    }
    $.validator.setDefaults({
        submitHandler: function () {
            document.getElementById("signupform").submit();

        }
    })
    $().ready(function () {
        $("#signupform").validate({
            rules: {
                arName: {
                    required: true,
                    minlength: 1,
                    maxlength: 12.
                },
                startTime: {
                    dateISO: true,

                },
                endTime: {
                    dateISO: true,

                },
            },
            messages: {
                arName: {
                    required: "请输入名称",
                    minlength: "最少输入{0}个字符",
                    maxlength: "最多输入{0}个字符"
                },
                startTime: {
                    date: "请输入有效的日期",

                },
                endTime: {
                    date: "请输入有效的日期",
                },
            },


        });
    });
	
</script> 